<mk-drawer-form
    v-model="drawer"
    :loading="drawerLoading"
    :title="typeof drawerData.id === 'undefined' ? '添加' : '编辑'"
    @save="saveDrawer()">
    <el-form
        :model="drawerData" 
        ref="drawerData" 
        :rules="drawerRules" 
        label-width="120px">
        <el-form-item label="轮播封面：" prop="cover">
            <mk-file-select v-model="drawerData.cover" type="image"></mk-file-select>
        </el-form-item>
        <el-form-item label="轮播视频：" prop="video">
            <mk-file-select v-model="drawerData.video" type="video"></mk-file-select>
        </el-form-item>
        <el-form-item label="分类信息：" prop="catalog_id">
            <el-select v-model="drawerData.catalog_id" placeholder="请选择分类，可多选" filterable multiple style="width: 100%;">
                <el-option
                    v-for="(item, index) in catalog"
                    :key="index"
                    :label="item.title"
                    :value="item.id">
                    <span v-html="item.treeString" class="mk-tree-name"></span>
                    {{ item.title }}
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="标题：" prop="title">
            <el-input v-model="drawerData.title"></el-input>
        </el-form-item>
        <el-form-item label="简短描述：" prop="detail">
            <el-input type="textarea" v-model="drawerData.detail"></el-input>
        </el-form-item>
        <el-form-item label="链接地址：" prop="link">
            <mk-link v-model="drawerData.link"></mk-link>
        </el-form-item>
        <el-form-item label="状态：" prop="status">
            <el-switch
                v-model="drawerData.status"
                active-color="#13ce66"
                :active-value="1"
                :inactive-value="0">
            </el-switch>
        </el-form-item>
        <el-form-item label="内容描述：" prop="content">
            <mk-editor v-model="drawerData.content"></mk-editor>
        </el-form-item>
    </el-form>
</mk-drawer-form>